<!--
    My account page
-->
<include target="_header.html" />
<include target="_my_account_sidebar.html" />

<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
    <p>{$XE_VALIDATOR_MESSAGE}</p>
</div>

<div id="body-content" class="body-two-columns main-content form">
    <!--@if(Context::get('act') == 'dispShopAddAddress' || Context::get('act') == 'dispShopEditAddress' ||$addresses->count == 0)-->
        <!--@if(isset($addresses->count))-->
            <h1>No addresses yet</h1>
        <!--@end-->
        <include target="address_form.html" />
    <!--@else-->
        <h1 class="underline">{$lang->address_book}</h1>
        <a class="button" href="{getURL('','act','dispShopAddAddress')}">Add a new address</a>
        <!--@if($addresses->default_shipping->address_srl == $addresses->default_billing->address_srl && isset($addresses->default_shipping))-->
            <h2>{$lang->default_shipping_billing_address}</h2>
            <!--@if(isset($addresses->default_shipping))-->
            <div id="default_shipping_billing">
                <p><b>{$lang->company}:</b>{$addresses->default_shipping->company}</p>
                <p><b>{$lang->firstname}:</b>{$addresses->default_shipping->firstname}</p>
                <p><b>{$lang->lastname}:</b>{$addresses->default_shipping->lastname}</p>
                <p><b>{$lang->email}:</b>{$addresses->default_shipping->email}</p>
                <p><b>{$lang->telephone}:</b>{$addresses->default_shipping->telephone}</p>
                <p><b>{$lang->fax}:</b>{$addresses->default_shipping->fax}</p>
                <p><b>{$lang->address}:</b>{$addresses->default_shipping->address}</p>
                <p><b>{$lang->additional_info}:</b>{$addresses->default_shipping->additional_info}</p>
                <p><b>{$lang->city}:</b>{$addresses->default_shipping->city}</p>
                <p><b>{$lang->region}:</b>{$addresses->default_shipping->region}</p>
                <p><b>{$lang->postal_code}:</b>{$addresses->default_shipping->postal_code}</p>
                <p><b>{$lang->country}:</b>{$addresses->default_shipping->country}</p>
                <p><a class="button" href="{getURL('','act','dispShopEditAddress','address_srl',$addresses->default_shipping->address_srl)}">Edit</a></p>
            </div>
            <!--@end-->
        <!--@else-->
            <h2>{$lang->default_shipping_address}</h2>
            <!--@if(isset($addresses->default_shipping))-->
            <div id="default_shipping">
                <p><b>{$lang->company}:</b> {$addresses->default_shipping->company}</p>
                <p><b>{$lang->firstname}:</b> {$addresses->default_shipping->firstname}</p>
                <p><b>{$lang->lastname}:</b> {$addresses->default_shipping->lastname}</p>
                <p><b>{$lang->email}:</b> {$addresses->default_shipping->email}</p>
                <p><b>{$lang->telephone}:</b> {$addresses->default_shipping->telephone}</p>
                <p><b>{$lang->fax}:</b> {$addresses->default_shipping->fax}</p>
                <p><b>{$lang->address}:</b> {$addresses->default_shipping->address}</p>
                <p><b>{$lang->additional_info}:</b> {$addresses->default_shipping->additional_info}</p>
                <p><b>{$lang->city}:</b> {$addresses->default_shipping->city}</p>
                <p><b>{$lang->region}:</b> {$addresses->default_shipping->region}</p>
                <p><b>{$lang->postal_code}:</b> {$addresses->default_shipping->postal_code}</p>
                <p><b>{$lang->country}:</b> {$addresses->default_shipping->country}</p>
                <p><a class="button" href="{getURL('','act','dispShopEditAddress','address_srl',$addresses->default_shipping->address_srl)}">Edit</a></p>
            </div>
            <!--@else-->
            Not yet set
            <!--@end-->

            <h2>{$lang->default_billing_address}</h2>
            <!--@if(isset($addresses->default_billing))-->
            <div id="default_billing">
                <p><b>{$lang->company}:</b> {$addresses->default_billing->company}</p>
                <p><b>{$lang->firstname}:</b> {$addresses->default_billing->firstname}</p>
                <p><b>{$lang->lastname}:</b> {$addresses->default_billing->lastname}</p>
                <p><b>{$lang->email}:</b> {$addresses->default_billing->email}</p>
                <p><b>{$lang->telephone}:</b> {$addresses->default_billing->telephone}</p>
                <p><b>{$lang->fax}:</b> {$addresses->default_billing->fax}</p>
                <p><b>{$lang->address}:</b> {$addresses->default_billing->address}</p>
                <p><b>{$lang->additional_info}:</b> {$addresses->default_billing->additional_info}</p>
                <p><b>{$lang->city}:</b> {$addresses->default_billing->city}</p>
                <p><b>{$lang->region}:</b> {$addresses->default_billing->region}</p>
                <p><b>{$lang->postal_code}:</b> {$addresses->default_billing->postal_code}</p>
                <p><b>{$lang->country}:</b> {$addresses->default_billing->country}</p>
                <p><a class="button" href="{getURL('','act','dispShopEditAddress','address_srl',$addresses->default_billing->address_srl)}">Edit</a></p>
            </div>
            <!--@else-->
            Not yet set
            <!--@end-->
        <!--@end-->

        <h2>{$lang->additional_addresses}</h2>
        <!--@if(isset($addresses->additional_addresses))-->
            <!--@foreach($addresses->additional_addresses as $address)-->
                <div class="additional_addresses">
                    <p><b>{$lang->company}:</b> {$address->company}</p>
                    <p><b>{$lang->telephone}:</b> {$address->telephone}</p>
                    <p><b>{$lang->fax}:</b> {$address->fax}</p>
                    <p><b>{$lang->address}:</b> {$address->address}</p>
                    <p><b>{$lang->additional_info}:</b> {$address->additional_info}</p>
                    <p><b>{$lang->city}:</b> {$address->city}</p>
                    <p><b>{$lang->region}:</b> {$address->region}</p>
                    <p><b>{$lang->postal_code}:</b> {$address->postal_code}</p>
                    <p><b>{$lang->country}:</b> {$address->country}</p>
                    <p>
                        <a class="button" href="{getURL('','act','dispShopEditAddress','address_srl',$address->address_srl)}">Edit</a>
                        <a class="button" href="{getURL('','act','procShopDeleteAddress','address_srl',$address->address_srl)}">Delete</a>
                    </p>
                </div>
            <!--@end-->
        <!--@else-->
            {$lang->no_additional_addresses}
        <!--@end-->
    <!--@end-->
</div>

<include target="_footer.html"/>